Imports System.Windows.Forms Public Class renameCountdown Private Sub renameCountdown_Load(sender As Object, e As EventArgs) Handles MyBase.Load Dim selItem As String Dim strArr() As String strArr = countdown.KryptonListBox1.SelectedItem.Split("|") selItem = (strArr(0).ToString) TextBox1.Text = selItem.Substring(0, selItem.Length - 1) End Sub Private Sub KryptonButton2_Click(sender As Object, e As EventArgs) Handles KryptonButton2.Click Me.Close() End Sub Private Sub KryptonButton1_Click(sender As Object, e As EventArgs) Handles KryptonButton1.Click Dim selItem As String Dim strArr() As String strArr = countdown.KryptonListBox1.SelectedItem.Split("| ") selItem = (strArr(1).ToString) countdown.KryptonListBox1.Items.Remove(countdown.KryptonListBox1.SelectedItem) countdown.KryptonListBox1.Items.Add(TextBox1.Text & " | " & selItem) Me.Close() End Sub Private Sub TextBox1_KeyDown(sender As Object, e As KeyEventArgs) Handles TextBox1.KeyDown If e.KeyCode = Keys.Enter Then Dim selItem As String Dim strArr() As String strArr = countdown.KryptonListBox1.SelectedItem.Split("| ") selItem = (strArr(1).ToString) countdown.KryptonListBox1.Items.Remove(countdown.KryptonListBox1.SelectedItem) countdown.KryptonListBox1.Items.Add(TextBox1.Text & " | " & selItem) Me.Close() End If If e.KeyCode = Keys.Escape Then Me.Close() End If End Sub End Class